package com.changgou.goods.exception;

import com.changgou.entity.Result;
import com.changgou.entity.StatusCode;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author: cxy
 * @Date: 2020/10/30 12:25
 * @Desc: Controller层的全局异常处理
 * @Version: 1.0.0
 */
@RestControllerAdvice
public class BaseExceptionHandler {

    @ExceptionHandler(Exception.class)
    public Result exceptionHandler(Exception e){
        e.printStackTrace();
        return new Result(false, StatusCode.ERROR, "系统正忙");
    }

}
